﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LotteryVote.Logic;

namespace LotteryVote
{
    public partial class OrderList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            InitParams();
        }

        void InitParams()
        {
            int userId = int.Parse(Request.QueryString["UserId"]);
            string type = Request.QueryString["type"];
            BetFacade betFacade = new BetFacade();
            var source = type == "all" ? betFacade.GetDescendantSettledOrderByUser(userId, DateTime.Today) :
                betFacade.GetDescendantSettledOrderByUser(userId, DateTime.Today);
            gv_orders.DataSource = source;
            gv_orders.DataBind();
        }
    }
}